#include "LPC11xx.h"
#include "utilfun.h"
#include "gpio.h"
#include "api_stiio.h"

/***************************************************************
 * Macro definitions                                           *
 ***************************************************************/

/***************************************************************
 * Globol variables                                            *
 ***************************************************************/

/***************************************************************
 * Functions                                                   *
 ***************************************************************/
void myDelay (uint32_t ulTime)
{
    uint32_t i;

    i = 0;
    while (ulTime--) {
        for (i = 0; i < 5000; i++);
    }
}

void halDataReceived(uint8_t * data, uint32_t len)
{
	GPIOSetValue(2, 7, !GPIOGetValue(2, 7));
	utilDelayMs(200);
	GPIOSetValue(2, 7, !GPIOGetValue(2, 7));
	utilDelayMs(200);
}

/***************************************************************
 * MAIN                                                        *
 ***************************************************************/
int main (void)
{
    SystemInit();             /* MUST BE INCLUDED! */

    GPIOInit();
    // LED
    GPIOSetDir(2, 7, GPIO_DIR_OUTPUT);

	utilInit();

	StiInit();
	MyStdout=LCD;

	printf("Hello,STIer!\n");

    while (1) {
		;
    }
}

/***************************************************************
 * END OF FILE                                                 *
 ***************************************************************/
